package com.uy.system.service.impl;

import com.uy.system.model.entity.SysUserRole;
import com.uy.system.mapper.SysUserRoleMapper;
import com.uy.system.service.ISysUserRoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 用户和角色关联表 服务实现类
 * </p>
 *
 * @author ly
 * @since 2024-03-22
 */
@Service
public class SysUserRoleServiceImpl extends ServiceImpl<SysUserRoleMapper, SysUserRole> implements ISysUserRoleService {

    @Override
    public int insertSysUserRole(SysUserRole role) {
        return baseMapper.insert(role);
    }

    @Override
    public int delSysUserRoleByUserId(Long userId) {
        if (userId == null) return 0;
        return baseMapper.delSysUserRoleByUserId(userId);
    }
}
